package cloud.seata.account.tcc;

import org.apache.seata.rm.tcc.api.BusinessActionContext;
import org.apache.seata.rm.tcc.api.BusinessActionContextParameter;
import org.apache.seata.rm.tcc.api.LocalTCC;
import org.apache.seata.rm.tcc.api.TwoPhaseBusinessAction;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;

import java.math.BigDecimal;

@LocalTCC
public interface TccAccountAction {

    @GetMapping("/prepare")
    @TwoPhaseBusinessAction(name = "TccAccountAction", commitMethod = "commit", rollbackMethod = "rollback")
    ResponseEntity<Boolean> prepare(BusinessActionContext actionContext);

    @GetMapping("/commit")
    boolean commit(BusinessActionContext actionContext);

    @GetMapping("/rollback")
    boolean rollback(BusinessActionContext actionContext);
}
